package com.blacamdk.ChatDatabase;

import java.sql.ResultSet;

/**
 * ChatDatabaseInterface
 *
 * @author BlacAmDK
 * @date 16-12-16
 */
public interface ChatDatabaseInterface {
    enum ERR_TYPE{
        OK, WRONG_PASSWORD, USERNAME_EXIST, USERNAME_NOT_EXIST, FAILED_TOO_MANY, FAILED, WRONG_KEY, OTHER
    }
    ERR_TYPE register(String username, String password);
    ERR_TYPE login(String username, String password, int status, String key);
    ERR_TYPE logout(String key, int uid);
    long send_to(String key, int from, int to, String content);
    ResultSet receive(String key, int uid, long time);
}
